TOC-PDA
To access the infinite memory space, an NFA is upgraded by a stack. A stack has these basic operations.
- Push
- Pop
The computational model combines a finite state machine and a stack is called pushdown automata
PDA
A pushdown automaton is a 6-tuple
is the finite set of states; is the finite input alphabet; is the finite stack alphabet; is the transition function; is the initial state; is the set of final states;
The transition function
Transition Function
If:
- The current state is
- The next input symbol is
- The symbol on top of the stack is
Then:
- The next state is
- The new stack symbol on the top is
PDA is defined from NFA.
is included in and . - The domain of
is the power set . has multiple choices for the next state.
Computation on PDA
An input string
(where is the initial state); (the stack is empty initially); ( is a final state); and - For
, where and for some and .
The last condition explains a transition.
- Each string
is the content of the stack. - The leftmost symbol in
is at the bottom of the stack. - The rightmost symbol in
is at the top of the stack ( and ). - The PDA consumes
, changes the stack symbol from to , and shifts to state .
Example
A PDA for